package com.chinacoal.microservice.controller;

import com.chinacoal.microservice.CostFactorTemplateClient;
import com.chinacoal.microservice.pojo.CcmsSmartleasingCoefficientTemplate;
import com.chinacoal.microservice.pojo.CcmsSmartleasingRoom;
import com.chinacoal.microservice.service.CostFactorTemplateService;
import com.chinacoal.microservice.util.PassToken;
import com.chinacoal.microservice.util.QueryCriteria;
import com.chinacoal.microservice.util.Result;
import com.chinacoal.microservice.util.UserLoginToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 费用系数模板-后端控制类
 * @date 2020-12-04 17：38
 */
@RestController
public class CostFactorTemplateController implements CostFactorTemplateClient {

    @Autowired
    private CostFactorTemplateService costFactorTemplateService;

    /**
     * @Description: 查询所有的费用系数信息(带分页)
     * @author zhuliang
     * @date 2020/11/25 20:20
     */
    @Override
    @UserLoginToken
    public Result<List<CcmsSmartleasingCoefficientTemplate>> getAllCostTemplate(QueryCriteria queryCriteria, String token) {
        return costFactorTemplateService.getAllCostTemplate(queryCriteria, token);
    }

    /**
     * @Description: 根据费用系数信息id查询费用系数信息
     * @author zhuliang
     * @date 2020/11/25 20:47
     */
    @Override
    @UserLoginToken
    public Result<CcmsSmartleasingCoefficientTemplate> getCostTemplateById(String pkCoefficientTemplateId, Integer status, String token) {
        return costFactorTemplateService.getCostTemplateById(pkCoefficientTemplateId, status, token);
    }

    /**
     * @Description: 根据费用系数信息实体,关闭费用系数
     * @author zhuliang
     * @date 2020/11/26 9:44
     */
    @Override
    @UserLoginToken
    public Result closeCoefficient( String pkCoefficientTemplateId, String token) {
        return costFactorTemplateService.closeCoefficient(pkCoefficientTemplateId, token);
    }

    /**
     * @Description: 添加费用系数模板信息
     * @author zhuliang
     * @date 2020/11/26 10:05
     */
    @Override
    @UserLoginToken
    public Result addCoefficient(CcmsSmartleasingCoefficientTemplate coefficientTemplate, String token) {
        return costFactorTemplateService.addCoefficient(coefficientTemplate, token);
    }

    /**
     * @Description: 费用系数模板的关联房间
     * @author zhuliang
     * @date 2020/11/26 15:40
     */
    @Override
    @UserLoginToken
    public Result<List<CcmsSmartleasingRoom>> modifyTheAssociatedRoom(String pkCoefficientTemplateId, String token) {
        return costFactorTemplateService.modifyTheAssociatedRoom(pkCoefficientTemplateId, token);
    }

    /**
     * @Description: 修改费用信息
     * @author zhuliang
     * @date 2020/11/30 18:54
     */
    @Override
    @UserLoginToken
    public Result<CcmsSmartleasingCoefficientTemplate> updateCoefficientTemplate(String token, CcmsSmartleasingCoefficientTemplate coefficientTemplate) {
        return costFactorTemplateService.updateCoefficientTemplate(token, coefficientTemplate);
    }

    /**
     * @Description: 查询所有的费用系数模板消息
     * @author zhuliang
     * @date 2020/11/30 19:17
     */
    @Override
    @UserLoginToken
    public Result<List<CcmsSmartleasingCoefficientTemplate>> getAllByCoefficient(String token) {
        return costFactorTemplateService.getAllByCoefficient(token);
    }

    /**
     * @Description: 条件查询费用系数模板信息(带分页)
     * @author zhuliang
     * @date 2020/11/26 18:36
     */
    @Override
    @UserLoginToken
    public Result<List<CcmsSmartleasingCoefficientTemplate>> conditionalQueryCoefficient(QueryCriteria queryCriteria, String token) {
        return costFactorTemplateService.conditionalQueryCoefficient(queryCriteria, token);
    }

}
